UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HoAiOlDqpbG7uHbkq/hQh/Ou0sG47mHY04ueWUd9+0I='
WHERE
key_id = '9ad27e6c015aa395c67a2d5665c6831732e03f7a892668bb953e85a6ec0db525'
AND (
token = 'HoAiOlDqpbG7uHbkq/hQh/Ou0sG47mHY04ueWUd9+0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)