UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tnAxanYeV3mifQyJiLBGhDI328WeZ5mMhvFkzUMGWTE='
WHERE
key_id = 'ade9c730810a13a0fced9862cfd40a6ed5b0010f0cb61ba16152a67707815260'
AND (
token = 'tnAxanYeV3mifQyJiLBGhDI328WeZ5mMhvFkzUMGWTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)