UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tpwCCICKRNR+PRNVMCMRXs7Rv6rcxWXDHmtUX4q2wDI=' 
WHERE 
  key_id = 'ec1da659e8f39ff970a41c581a17566f51fc46b1d136eaa772b9fae7778a6d9d' 
  AND (
    token = 'tpwCCICKRNR+PRNVMCMRXs7Rv6rcxWXDHmtUX4q2wDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021