UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aK0dcrnAZAHd96Z1PGYHVTFI/6PG0CDRP4Pd2vlU17Y='
WHERE
key_id = '02042a321b61503270f8dad9b4e961a4f1021f7e11ed9c8805e09d2f26feb7f6'
AND (
token = 'aK0dcrnAZAHd96Z1PGYHVTFI/6PG0CDRP4Pd2vlU17Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)