UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jld1B78zpg6tcj2Se6whwswcQH2y8WCNG+zsOd1Keo8='
WHERE
key_id = '0977d860e6d048c80b416754bf6461dcbd955d1f838f166b6c88820893e81199'
AND (
token = 'Jld1B78zpg6tcj2Se6whwswcQH2y8WCNG+zsOd1Keo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)