UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SHXFWJzdyeV+8ddkDQ+H8gXzA74mPG6CiqhiQYElngI='
WHERE
key_id = '36ab952c592afd4f5e9ba504859b2c83dcc44f15102911e440c29bf4149a0d7a'
AND (
token = 'SHXFWJzdyeV+8ddkDQ+H8gXzA74mPG6CiqhiQYElngI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)