UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oIDfIGXD4Gl3OoZMxlqLwnIcv4FVzeeDzYzvd0gbXUs='
WHERE
key_id = '61d5b0c4bf6e496053b6ab14125ca47d8eabd1b9f258d1efd66ebd63a35b730a'
AND (
token = 'oIDfIGXD4Gl3OoZMxlqLwnIcv4FVzeeDzYzvd0gbXUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)