UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q9x2FkDEEyQ90YUkZTugm8jNWtQRspvRfOHKfSUY7Vg=' 
WHERE 
  key_id = '7b2522b9e7070edece66fc6678b9a74b9d6b0ee63e5da3030fdd50be6a5d77e6' 
  AND (
    token = 'q9x2FkDEEyQ90YUkZTugm8jNWtQRspvRfOHKfSUY7Vg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035