UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ViBgGWZIK+bR3I7m2AcQ4S/W0Jn9Hx7afV+6Fl4rWmA='
WHERE
key_id = '5ef33646a70f6400eb6d7b7cd1d03019dd610b2dcbab1360b4ca6c9c154a575c'
AND (
token = 'ViBgGWZIK+bR3I7m2AcQ4S/W0Jn9Hx7afV+6Fl4rWmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)