UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kMCU190Ddof2i763p8hvJWssLiOCtYoLAZIBsZqqwp4='
WHERE
key_id = '5a7d5b79d59d2e83a923291a59da79b821f6fca5ffc591e2330fbea874b19965'
AND (
token = 'kMCU190Ddof2i763p8hvJWssLiOCtYoLAZIBsZqqwp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)