UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OR0b4pqtAQBjZ/mAg6nzTH7WPZIXBd4+8REGNLcNfYQ='
WHERE
key_id = '8b1f16bd6ff6385e0871d87c05dd57e41eb6f93236dad2afe5995c513084ca97'
AND (
token = 'OR0b4pqtAQBjZ/mAg6nzTH7WPZIXBd4+8REGNLcNfYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)