UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ADl82/75gKBPkQ+FJ2B9emHXtYJaMZGlvRVou2ctcuM=' 
WHERE 
  key_id = 'ac8f5d3848f20d515262d189a1ba5ddb0b61973df4084cfed75a5145b159876a' 
  AND (
    token = 'ADl82/75gKBPkQ+FJ2B9emHXtYJaMZGlvRVou2ctcuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057