UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jQG5f7NzGxoxu/eSZzUyTxKeIkNWILp8mTqrJPFmJ0U='
WHERE
key_id = '53ef9c1d796c2d84aaab7d95d963dc8c4350469f819393ed91be7c012eae8a30'
AND (
token = 'jQG5f7NzGxoxu/eSZzUyTxKeIkNWILp8mTqrJPFmJ0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)