UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1qcnW788sUXebbMJGuxhCX1Ccvo8I9XZoTNhjvHg6mk=' 
WHERE 
  key_id = 'a69c60e828369aafbfa75001e7beaf58f7ac21c30783a662dd40e3e94aa4b061' 
  AND (
    token = '1qcnW788sUXebbMJGuxhCX1Ccvo8I9XZoTNhjvHg6mk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033