UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wsZugyd5wq7Un0O46s3QOdyD8VxQ6ayJrUkLixeX0LY='
WHERE
key_id = '3e06d2cfba9d64782af160232145c10f10e7cccdb06faa79236a1d8cff8f20a4'
AND (
token = 'wsZugyd5wq7Un0O46s3QOdyD8VxQ6ayJrUkLixeX0LY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)