UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hEMITnkBawhkizmbDQghAwCruED8Q/GYme1wEPcBX0='
WHERE
key_id = '7bea6ef1cc2fcfe1961943eaa20f01359a6d72c4e894e197647ac6c9c44a357f'
AND (
token = '3hEMITnkBawhkizmbDQghAwCruED8Q/GYme1wEPcBX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)