UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+nhkuHT6ghL76ILqKm2s2XyiRTzxV33pnfsCzuPB2p4='
WHERE
key_id = '775e7c820b9eb8fb08b9bccbc24c1514a89a5dc82e74fc980428fc8b3617adc2'
AND (
token = '+nhkuHT6ghL76ILqKm2s2XyiRTzxV33pnfsCzuPB2p4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)