UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I7N0Sg+6n5gEzheLxO1H0fCHlhtFLHprwYwv2vmeF8I='
WHERE
key_id = '80500adc04735c2116d982d19717304271cefe5f9a3522e626667eba10340377'
AND (
token = 'I7N0Sg+6n5gEzheLxO1H0fCHlhtFLHprwYwv2vmeF8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)