UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IAXoqy7rBKq5fQ3A+xX0xNvmHfNAruz3WLMV9rtqi7A=' 
WHERE 
  key_id = '5f08e8792b811e7439463700c1007110ef27f02cc4d13c2ba89e9c11d9046a2e' 
  AND (
    token = 'IAXoqy7rBKq5fQ3A+xX0xNvmHfNAruz3WLMV9rtqi7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031