UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wDjUN+nBwNXlFxK5nKF4SN6ys2XPFHLxVHDOjoB/xTU='
WHERE
key_id = '6f268d20dcb8d79b2f3c93c8d1bf64aed547a8c84b6dda238a60120e47a81500'
AND (
token = 'wDjUN+nBwNXlFxK5nKF4SN6ys2XPFHLxVHDOjoB/xTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)