UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CoF+2LxXPQ44uzBiB9pI4s/PZ9qm6L/r+EmIhYTj+tM=' 
WHERE 
  key_id = '050db5b4975045e99ee65cdde41599558cb0027d6c99c5f607f983343245a2a2' 
  AND (
    token = 'CoF+2LxXPQ44uzBiB9pI4s/PZ9qm6L/r+EmIhYTj+tM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027