UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r+gHwo0xmhXtSNrXLorPY0t4r+jmy5glYvVG8NyoLjk='
WHERE
key_id = '52792ebee33e32b3ec7742899956cec82772bee374b39fdbc8579c1390d429cb'
AND (
token = 'r+gHwo0xmhXtSNrXLorPY0t4r+jmy5glYvVG8NyoLjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)