UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Pkmdsd1Cjp7pPTt8+vBkXkRfSdXJFokVZRG8q8FNHs=' 
WHERE 
  key_id = '8739ea5c18aa64c6a925164d8cbc43181c757a921a7d4a2cdd7ab20358328f93' 
  AND (
    token = '/Pkmdsd1Cjp7pPTt8+vBkXkRfSdXJFokVZRG8q8FNHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022