UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VRP9yM15abzaGLmND5SU6xEbQsbIvaNSp7yDwaPn8/E='
WHERE
key_id = '7d4b9acaf12ea262ad7a7b1ebbb5fa1ba3ddbda4d9bc2833d61f19984b1a7323'
AND (
token = 'VRP9yM15abzaGLmND5SU6xEbQsbIvaNSp7yDwaPn8/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)