UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MpqMRti3xR8HZJbvwFQwZu0XGXLU25bMm7kRuZyapH0=' 
WHERE 
  key_id = 'cb6d3c557f94f7d75957a3f6f63f2ffd472230cd7d837574cf76c01d0534b5b4' 
  AND (
    token = 'MpqMRti3xR8HZJbvwFQwZu0XGXLU25bMm7kRuZyapH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022