UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JqLSKUlAcTUjtI0GaH+YBglFt5EhokD3UjoQPg4FRDw=' 
WHERE 
  key_id = 'a216197ee03e0370f6316ba259c5d125e3226b6731c4de5fcdb899c652d036b9' 
  AND (
    token = 'JqLSKUlAcTUjtI0GaH+YBglFt5EhokD3UjoQPg4FRDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030