UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+SJsu5+k86RU22Bn3NUwL5bxOYZaULGIt6McoRlbC3s=' 
WHERE 
  key_id = '0043619c19a299070914b14f71c7c23aa058c52a60089921a94a59759ccb94ea' 
  AND (
    token = '+SJsu5+k86RU22Bn3NUwL5bxOYZaULGIt6McoRlbC3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029