UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nnjWnBPjxf3yS4mLxQx0CA3tzv+WsHSyNPFZAR3ZmHI=' 
WHERE 
  key_id = '8d98bbdd3d86169a8afc57270ae40d3566cfc3a3db3cd361466e6277a102f3e5' 
  AND (
    token = 'nnjWnBPjxf3yS4mLxQx0CA3tzv+WsHSyNPFZAR3ZmHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039