UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1H3a7P7vvmCp0sjQVq/wx/HnLBYvHKs0VYhSuUbFyso=' 
WHERE 
  key_id = 'bb1a00c438d45a8e28eb6b197ff84741ae7ec841f498d884ed6a089624d9590b' 
  AND (
    token = '1H3a7P7vvmCp0sjQVq/wx/HnLBYvHKs0VYhSuUbFyso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038