UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vZH5c1bO5b1aCSA2NXAfZ7r8D3jyshYddF9wOUIsRrQ='
WHERE
key_id = '6d386b081215c3bebac17106a6fb8c74f29b218ba74f8d5811407b78eabb1832'
AND (
token = 'vZH5c1bO5b1aCSA2NXAfZ7r8D3jyshYddF9wOUIsRrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)