UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZDx6uF1P2v0Qzxl1tqTt6Y/cmIeoCadvssBdGVo8MTg='
WHERE
key_id = '03cb30f150d373643c4546083294b6d6b8dd86ea78ec0da799c65dd3bec568c7'
AND (
token = 'ZDx6uF1P2v0Qzxl1tqTt6Y/cmIeoCadvssBdGVo8MTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)