UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/BKedhgrbgHgyJ1CoWJFvrwWPXRwBicvJvpfJYEfDY4='
WHERE
key_id = '1a2645581b17d310ac3a62c048f7093da11d8ade2a8154f0759bb00272ca121c'
AND (
token = '/BKedhgrbgHgyJ1CoWJFvrwWPXRwBicvJvpfJYEfDY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)