UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vvypSqyo5M0xQPRdxo4N/Y9lQ6Ob+Gr8HShc4GgNRbk=' 
WHERE 
  key_id = 'ede28252af3ca120d35df7d9d86ca29c979c1e61d988b000060316b4d85925d7' 
  AND (
    token = 'vvypSqyo5M0xQPRdxo4N/Y9lQ6Ob+Gr8HShc4GgNRbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035