UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DbPtz4x9VTdXXUBxA+1kHNHnwfmU+lOtrmqp6DZFnkc='
WHERE
key_id = '25e04f453772fe20eef7c400c1591654295dde0d652db39d3775b66f23685048'
AND (
token = 'DbPtz4x9VTdXXUBxA+1kHNHnwfmU+lOtrmqp6DZFnkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)