UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqFQqpfOhOI/L4VAm48Sv/CQw0ky6x86T4f2YskozxM='
WHERE
key_id = '5bc68af4199dbcce003cd3f238a6ede7ae81688e82d8324199bc1c3e8097525a'
AND (
token = 'uqFQqpfOhOI/L4VAm48Sv/CQw0ky6x86T4f2YskozxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)