UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91ZUp1g5jjQRoQKG128YP2PTJk7cOI5aD4xFe9VdBK8='
WHERE
key_id = 'e2dc49a072c177d7feb5270ae78709c5bc28fb3a1dffe4445b3d37884fdb0080'
AND (
token = '91ZUp1g5jjQRoQKG128YP2PTJk7cOI5aD4xFe9VdBK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)