UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FlLRCEVCBn47IQ3DbmU7kGrbz9X4j05q6ZtaEPE2C7s='
WHERE
key_id = '39b76f42075394a07fb29913c087d59876d06b3f33ba72803bd772fb5971d246'
AND (
token = 'FlLRCEVCBn47IQ3DbmU7kGrbz9X4j05q6ZtaEPE2C7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)