UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LooGZBG1ANWkLJ+2xr2+Mo+ehKhAQIDvsWlevxqsQlk='
WHERE
key_id = '079039df46a7db2ae55546eecd6cab20c2d1297aba7471bbe6cdc749ee524c59'
AND (
token = 'LooGZBG1ANWkLJ+2xr2+Mo+ehKhAQIDvsWlevxqsQlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)