UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nSLDzTQ6Q/IZ4g4tDtHvmCSu98y8Mn0EBKk7kYjvXnM='
WHERE
key_id = 'c0ff247a244a197c39d14628820e6b1f59623a47502146e6022a3f0918dd9c25'
AND (
token = 'nSLDzTQ6Q/IZ4g4tDtHvmCSu98y8Mn0EBKk7kYjvXnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)