UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zXxT1LdqiTIYoLhKv5d2cILTf6N+6jvgu1X2Mp1YEDA=' 
WHERE 
  key_id = '8438466ee9da83add97cbf182051858c8998c43e94aad82815f9d576a6a96cfb' 
  AND (
    token = 'zXxT1LdqiTIYoLhKv5d2cILTf6N+6jvgu1X2Mp1YEDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051