UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MB1xBG8W6QuHSw3+/DAjcX8N1MYZ4KPmdJDsTd3ZZyg=' 
WHERE 
  key_id = '80218099252bbf694e8dfc86d3b079e643e5adc1ba5b9382fc7a7472c9444846' 
  AND (
    token = 'MB1xBG8W6QuHSw3+/DAjcX8N1MYZ4KPmdJDsTd3ZZyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038