UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'egP0xmckp2TvGzN6eT2QxkczMNpSieJ5Qp6izywwcFE='
WHERE
key_id = '0b87218bea0cf84c0c3693f357a7b9a85f684a0f902088fe9985ea280ddcca14'
AND (
token = 'egP0xmckp2TvGzN6eT2QxkczMNpSieJ5Qp6izywwcFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)