UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4sjUoQiaCLe4wSxm3zgsrJe/dJ4Wx4tDpTr77yYK/M='
WHERE
key_id = 'ecde24a87285911cec6bbda964ad96453f146ca08009717c7bf2334459cd32ad'
AND (
token = '+4sjUoQiaCLe4wSxm3zgsrJe/dJ4Wx4tDpTr77yYK/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)