UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '80Tb6mGAg+8QzqL0soOvmJcHZ1C7RPvJOiwW7Eag4W8='
WHERE
key_id = 'ee6116067ebc764d3ef62d2d88b381c01da8e1208e6a96fb65c28d3e16f87a14'
AND (
token = '80Tb6mGAg+8QzqL0soOvmJcHZ1C7RPvJOiwW7Eag4W8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)